package com.iuie.ns.devtools.transfer;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.iuie.ns.system.service.code.ISysCodeInfoService;
import com.iuie.ns.system.vo.code.SysCodeInfoVO;

public abstract class BaseDevTransfer implements IDevTransfer {

	@Resource
	protected ISysCodeInfoService sysCodeService;
	
	private Map<String, String> fieldTypeRelationMap;

	protected Map<String, String> getFieldTypeRelationMap() {
		if (fieldTypeRelationMap == null) {
			fieldTypeRelationMap = new HashMap<>();
			List<SysCodeInfoVO> fieldTypeRelation = sysCodeService.findByCodeTypeId("fieldTypeWithJavaRelation", 1);
			if (fieldTypeRelation != null && fieldTypeRelation.size() > 0) {
				for (SysCodeInfoVO codeInfo: fieldTypeRelation) {
					fieldTypeRelationMap.put(codeInfo.getCodeInfoValue(), codeInfo.getCodeInfoName());
				}
			}
		}
		return fieldTypeRelationMap;
	}
}
